def extract_layer():
    import nuke
    i = nuke.selectedNode()
    channels = i.channels()
    layer = []
    for x in channels:
        layer.append(x.split('.')[0])
        layer = list(set(layer))
    for L in layer:
        newnode = nuke.nodes.Shuffle()
        newnode.setInput(0,i)
        newnode['in'].setValue(L)
        newnode['label'].setValue(L)
  